/**
 * 
 */
package com.ms.player;

import java.io.Serializable;
import java.math.BigDecimal;

import com.xpec.c4.message.ConstantCode;

/**
 * 更新角色屬性的個別項目資料結構
 * 
 * @author TW15010
 * 
 */
public class UpdateAttribute implements Serializable {
	private static final long serialVersionUID = -5922105638334837175L;

	/**
	 * 屬性代號
	 * 
	 * @see PlayerAttributeType
	 */
	private int id;

	/**
	 * 屬性數值
	 */
	private String value;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public long getValueLong() {
		return Long.valueOf(value);
	}

	public int getValueInt() {
		return Integer.valueOf(value);
	}

	public BigDecimal getValueBigDecimal() {
		return new BigDecimal(value);
	}
	
	public Boolean getValueBoolean(){
		return new Boolean(value);		
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	@Override
	public String toString() {
		// LEVEL(4)=50
		return ConstantCode.getName(PlayerAttributeType.class, getId()) + "(" + getId() + ")=" + getValue();
	}
}
